import QtQuick 1.0
import com.meego 1.0
import QtMultimediaKit 1.1


Rectangle {
    id: dialog
    width: 300
    height: 130
    radius: 11
    gradient: Gradient {
        GradientStop {
            position: 0.02
            color: "#ffffff"
        }

        GradientStop {
            position: 0.14
            color: "#ffffff"
        }

        GradientStop {
            position: 1
            color: "#141212"
        }
    }

    property alias setMessage: message.text

    onOpacityChanged: {
        if (dialog.opacity == 1)
            showSound.play();
    }

    Behavior on opacity {
        NumberAnimation { easing.type: Easing.OutBack; duration: 800 }
    }

    border.width: 1
    border.color: "#f9f4f4"

    SoundEffect {
        id: showSound
        source: "../../Audio/show.wav"
    }

    SoundEffect {
        id: clickSound
        source: "../../Audio/click.wav"
    }

    Image {
        id: imageKeys
        x: 14
        y: 21
        width: 32
        height: 32
        source: "qrc:/keys.png"
    }

    Text {
        id: message
        x: 41
        y: 20
        width: 250
        height: 100
        text: "Il veicolo ricercato non risulta denunciato!"
        smooth: true
        horizontalAlignment: Text.AlignHCenter
        wrapMode: Text.WrapAtWordBoundaryOrAnywhere
        font.pixelSize: 18
    }

    Button {
        id: btnOk
        x: 90
        y: 78
        width: 121
        height: 39
        text: "OK"
        smooth: true
        iconSource: "qrc:/ok.png"
        onClicked: {
            clickSound.play();
            dialog.opacity = 0;
        }
    }
}
